package cn.com.utt.common.message;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;

public class GetXml extends Message {
	@JSONField(name="sn") 
	private String sn;
	@JSONField(name="replyto") 
	private String replyTo;
	@JSONField(name="data") 
	private Object data;
	
	public GetXml(){
		setType(MessageType.GETXML.toString());
	}

	@Override
	public String encode() {
		return JSON.toJSONString(this);
	}

	@Override
	public void decode(byte[] buf){
		GetXml get = JSON.parseObject(buf, GetXml.class);
		this.setId(get.getId());
		this.sn = get.getSn();
		this.replyTo = get.getReplyTo();
		this.data  = get.getData();
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getReplyTo() {
		return replyTo;
	}

	public void setReplyTo(String replyTo) {
		this.replyTo = replyTo;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
